<template>
  <div>
    <aplayer preload="auto" :music="{
      artist:' ',
      title: title,
      src: audioUrl,
      pic:require('@/assets/i/wap/clockIn/audio_cover_d.png'),
    }" :volume="1" repeat="repeat-one" :isAplayerShow="isAplayerShow" @play="playAplayer"/>
  </div>
</template>
<script>
import VueAPlayer from "@/plugin/vue-aplayer/vue-aplayer.vue";
export default {
  name: "problem",
  components: {
    Aplayer: VueAPlayer,
  },
  props: {
    title: {
      type: String,
      default: ''
    },
    audioUrl: {
      type: String,
      default: ''
    },
  },
  data() {
    return {
      isAplayerShow:false
    };
  },
  watch: {
  },
  mounted() {
  },
  methods: {
    playAplayer(src) {
      if (typeof src == 'string') {
        let arr = document.getElementsByTagName("audio");
        for (let i = 0; i < arr.length; i++) {
          if (arr[i].src !== src) {
            arr[i].pause();
          }
        }
      }
    },
  },
  destroyed() {
  }
};
</script>

<style scoped>
</style>
